<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      th:replace="fragments/layout(title='基本信息',cssPaths='/static/css/baseinfo/yljg.css',jsPaths='/static/js/baseinfo/jgxx.js')">
    <div class="right" th:fragment="right">
        <!--面包屑-->
        <div class="breadcrumb layui-bg-gray">
            <span class="layui-breadcrumb" lay-separator=">">
                <a th:href="@{/}">首页</a>
                <a href="javascript:void(0)">系统管理</a>
                <a><cite>基本信息</cite></a>
            </span>
        </div>

        <!--主体内容区-->
        <div class="form-content">
            <form class="layui-form" th:action="@{/organization/save}" method="post">
                <div class="layui-row">
                    <div class="layui-col-md4">
                        <div class="layui-form-item">
                            <label class="layui-form-label">机构名称</label>
                            <div class="layui-input-block">
                                <input type="text" readonly th:disabled="${session.organization.name != null}" th:value="${session.organization.name}"   autocomplete="off" th:class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md4">
                        <div class="layui-form-item">
                            <label class="layui-form-label">主管单位</label>
                            <div class="layui-input-block">
                                <input type="text" readonly th:disabled="${session.organization.mzName != null}" th:value="${session.organization.mzName}"   autocomplete="off" th:class="layui-input">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-row">
                    <div class="layui-col-md4">
                        <div class="layui-form-item">
                            <label class="layui-form-label must">法人</label>
                            <div class="layui-input-block">
                                <input type="text" name="corporation"   maxlength="10" autocomplete="off" th:class="layui-input" lay-verify="required" th:value="${session.organization.corporation}">
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md4">
                        <div class="layui-form-item">
                            <label class="layui-form-label must">法人手机</label>
                            <div class="layui-input-block">
                                <input type="text"  name="corporationPhone" autocomplete="off" th:class="layui-input" lay-verify="phone" th:value="${session.organization.corporationPhone}">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-row">
                    <div class="layui-col-md4">
                        <div class="layui-form-item">
                            <label class="layui-form-label">机构星级</label>
                            <div class="layui-input-block">
                                <select name="star">
                                    <option value=""></option>
                                    <option value="0" th:selected="${session.organization.star eq 0}">暂无星级</option>
                                    <option value="1" th:selected="${session.organization.star eq 1}">1星</option>
                                    <option value="2" th:selected="${session.organization.star eq 2}">2星</option>
                                    <option value="3" th:selected="${session.organization.star eq 3}">3星</option>
                                    <option value="4" th:selected="${session.organization.star eq 4}">4星</option>
                                    <option value="5" th:selected="${session.organization.star eq 5}">5星</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md4">
                        <div class="layui-form-item">
                            <label class="layui-form-label">经营面积</label>
                            <div class="layui-input-inline" >
                                <input type="number" name="totalArea" th:value="${session.organization.totalArea}" oninput="if(value.length>10)value=value.slice(0,10)"   placeholder="请输入经营总面积" autocomplete="off" class="layui-input">
                            </div>
                            <div class="layui-form-mid layui-word-aux">平方米</div>
                        </div>
                    </div>
                </div>

                <div class="layui-row">
                    <div class="layui-col-md4">
                        <div class="layui-form-item">
                            <label class="layui-form-label">注册时间</label>
                            <div class="layui-input-block">
                                <input type="text" readonly="readonly" name="registeredDate" th:value="${#dates.format(session.organization.registeredDate,'yyyy-MM-dd')}" id="registeredDate"   placeholder="请输入注册时间" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-col-md4" >
                        <div class="layui-form-item" >
                            <label class="layui-form-label">注册资金</label>
                            <div class="layui-input-inline" >
                                <input type="number" name="registeredCapital" th:value="${session.organization.registeredCapital}" oninput="if(value.length>10)value=value.slice(0,10)"   placeholder="请输入注册资金" autocomplete="off" class="layui-input">
                            </div>
                            <div class="layui-form-mid layui-word-aux">万元</div>
                        </div>
                    </div>
                </div>

                <div class="layui-row">
                    <div class="layui-col-md12">
                        <div class="layui-form-item">
                            <label class="layui-form-label must">机构地址</label>
                            <div class="layui-input-inline">
                                <!--<div class="city-picker-selector" id="city-picker-selector1"></div>-->
                                <select id="province" lay-filter="province" lay-verify="required">
                                    <option value="">请选择省</option>
                                    <option th:each="p : ${provinceList}" th:value="${p.id}" th:text="${p.name}"
                                            th:selected="${session.organization.provinceCode eq p.id}"></option>
                                </select>
                            </div>
                            <div class="layui-input-inline">
                                <select id="city" lay-filter="city" lay-verify="required">
                                    <option value="">请选择市</option>
                                    <option th:if="null != ${cityList}" th:each="p : ${cityList}"
                                            th:value="${p.id}" th:text="${p.name}"
                                            th:selected="${session.organization.cityCode eq p.id}"></option>
                                </select>
                            </div>
                            <div class="layui-input-inline">
                                <select id="area" lay-filter="area" lay-verify="required">
                                    <option value="">请选择区(县)</option>
                                    <option th:if="null != ${areaList}" th:each="p : ${areaList}"
                                            th:value="${p.id}" th:text="${p.name}"
                                            th:selected="${session.organization.areaCode eq p.id}"></option>
                                </select>
                            </div>
                            <div class="layui-input-inline">
                                <select id="town" lay-filter="town" lay-verify="required">
                                    <option value="">请选择乡镇(街道)</option>
                                    <option th:if="null != ${townList}" th:each="p : ${townList}"
                                            th:value="${p.id}" th:text="${p.name}"
                                            th:selected="${session.organization.townCode eq p.id}"></option>
                                </select>
                            </div>
                            <div class="layui-input-inline">
                                <select id="village" lay-filter="village" lay-verify="required">
                                    <option value="">请选择社区(村)</option>
                                    <option th:if="null != ${villageList}" th:each="p : ${villageList}"
                                            th:value="${p.id}" th:text="${p.name}"
                                            th:selected="${session.organization.villageCode eq p.id}"></option>
                                </select>
                            </div>

                            <input type="hidden" id="provinceCode" name="provinceCode"  th:value="${session.organization.provinceCode}" >
                            <input type="hidden" id="cityCode" name="cityCode"  th:value="${session.organization.cityCode}" >
                            <input type="hidden" id="areaCode" name="areaCode"  th:value="${session.organization.areaCode}" >
                            <input type="hidden" id="townCode" name="townCode"  th:value="${session.organization.townCode}" >
                            <input type="hidden" id="villageCode" name="villageCode"  th:value="${session.organization.villageCode}" >
                            <input type="hidden" id="provinceName" name="provinceName"  th:value="${session.organization.provinceName}" >
                            <input type="hidden" id="cityName" name="cityName"  th:value="${session.organization.cityName}" >
                            <input type="hidden" id="areaName" name="areaName"  th:value="${session.organization.areaName}" >
                            <input type="hidden" id="townName" name="townName"  th:value="${session.organization.townName}" >
                            <input type="hidden" id="villageName" name="villageName"  th:value="${session.organization.villageName}" >
                        </div>
                        <div class="layui-col-md8 layui-col-md-offset1 layui-input-block">
                            <input type="text" name="address" id="address" required th:value="${session.organization.address}" maxlength="200" lay-verify="required" placeholder="请输入详细地址" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layui-row">
                        <div class="layui-input-inline">
                            <label class="layui-form-label">坐标</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="lng" id="lng" readonly placeholder="经度" autocomplete="off" class="layui-input" th:value="${session.organization.lng}" >
                                </div>
                                <div class="layui-input-inline">
                                    <input type="text" name="lat" id="lat" readonly placeholder="纬度" autocomplete="off" class="layui-input" th:value="${session.organization.lat}" >
                                </div>
                            <div class="layui-input-inline">
                                <button class="layui-btn " type="button" id="baiduBtn">标记位置</button>
                            </div>
                        </div>
                </div>
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">机构简介</label>
                    <div class="layui-input-block">
                        <textarea name="jgRemark" placeholder="机构简介" maxlength="2000" class="layui-textarea" style="width: 1000px" th:text="${session.organization.jgRemark}"></textarea>
                    </div>
                </div>
                <div class="layui-row" style="padding: 20px 0;">
                    <div class="layui-col-md1 label">
                        负责人资质
                    </div>
                    <div class="layui-col-md10 qtxk-box">
                        <div th:if="${fzrs!= null}" th:each="cert:${fzrs}" class="layui-upload-list" style="margin:0 10px 5px;">
                            <img class="layui-upload-img" th:src="@{'/storage/images/' + ${cert.path} +'_120x120'}"/>
                            <p class="file-nme" th:title="${cert.name}" th:text="${cert.name}"></p>
                            <p class="msg-box">
                                <a target="_blank" th:href="@{'/storage/files/' + ${cert.path}}" class="layui-btn layui-btn-normal layui-btn-xs">查看</a>
                                <a  th:href="@{'/storage/files/dl/' + ${cert.path}}" class="layui-btn layui-btn-normal  layui-btn-xs">下载</a>
                                <a  th:href="@{/organization/delzshu(id=${cert.id})}" class="layui-btn layui-btn-normal  layui-btn-xs">删除</a>
                            </p>
                        </div>
                        <img class="layui-upload-img" src="/static/imgs/imgup.png" id="fzr">
                    </div>
                </div>
                <div class="layui-row" style="padding: 20px 0;">
                    <div class="layui-col-md1 label">
                        机构照片
                    </div>
                    <div class="layui-col-md10 qtxk-box">
                        <div th:if="${jgzps != null}" th:each="cert:${jgzps}" class="layui-upload-list" style="margin:0 10px 5px;">
                            <img class="layui-upload-img" th:src="@{'/storage/images/' + ${cert.path} +'_120x120'}"/>
                            <p class="file-nme" th:title="${cert.name}" th:text="${cert.name}"></p>
                            <p class="msg-box">
                                <a target="_blank" th:href="@{'/storage/files/' + ${cert.path}}" class="layui-btn layui-btn-normal layui-btn-xs">查看</a>
                                <a  th:href="@{'/storage/files/dl/' + ${cert.path}}" class="layui-btn layui-btn-normal  layui-btn-xs">下载</a>
                                <a  th:href="@{/organization/delzshu(id=${cert.id})}" class="layui-btn layui-btn-normal  layui-btn-xs">删除</a>
                            </p>
                        </div>
                        <img class="layui-upload-img" src="/static/imgs/imgup.png" id="jgzp">
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn layui-btn-normal" lay-submit lay-filter="submitBtn">保存</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</html>
